<!-- 文档中心右侧目录，最多显示 3 级目录 -->
<template>
  <div v-if="list.length" class="flex flex-col">
    <div class="text-xl mb-6 font-bold">本页目录</div>
    <div class="border-l-2">
      <DocDirectoryItem :list="list" :level="1" />
    </div>
  </div>
</template>

<script lang="ts" setup>
import { defineProps } from "vue";
import DocDirectoryItem from "./doc-directory-item.vue";

interface DocDirectoryData {
  title: string;
  children?: DocDirectoryData[];
}

defineProps<{
  list: DocDirectoryData[];
}>();
</script>

<style lang="scss" scoped></style>
